package com.mce.nebula.entity;

import com.mce.nebula.common.BaseEntity;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 云市应用包实体，对应Python的RainbondCenterApp模型
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "rainbond_center_app", indexes = {
    @Index(name = "rainbond_center_app_filter_IDX", 
           columnList = "scope, arch, is_version, create_team, app_name"),
    @Index(name = "update_time_IDX", columnList = "update_time")
})
public class RainbondCenterApp extends BaseEntity {
    
    @Column(name = "app_id", length = 32, nullable = false)
    private String appId;
    
    @Column(name = "app_name", length = 64, nullable = false)
    private String appName;
    
    @Column(name = "create_user")
    private Integer createUser;
    
    @Column(name = "create_team", length = 64)
    private String createTeam;
    
    @Column(name = "pic", length = 200)
    private String pic;
    
    @Column(name = "source", length = 128)
    private String source;
    
    @Column(name = "dev_status", length = 32)
    private String devStatus;
    
    @Column(name = "scope", length = 50, nullable = false)
    private String scope; // enterprise, team, goodrain
    
    @Column(name = "description", length = 400)
    private String description;
    
    @Column(name = "is_ingerit", nullable = false)
    private Boolean isIngerit = true;
    
    @Column(name = "enterprise_id", length = 32)
    private String enterpriseId = "public";
    
    @Column(name = "install_number", nullable = false)
    private Integer installNumber = 0;
    
    @Column(name = "is_official", nullable = false)
    private Boolean isOfficial = false;
    
    @Column(name = "details", columnDefinition = "TEXT")
    private String details;
    
    @Column(name = "arch", length = 32, nullable = false)
    private String arch;
    
    @Column(name = "is_version", nullable = false)
    private Boolean isVersion = false;
}





